﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EasyStep.Data.Entities;
using NHibernate.Criterion;
using EasyStep.Business.Interfaces.Providers;

namespace EasyStep.Business.Providers
{
    public class TestProjectProvider : DataProviderBase<TestProject>, ITestProjectProvider
    {    
        public IEnumerable<TestProject> GetUserProjects(Guid userId)
        {
            using (var sm = CreateSessionManager(true))
            {
                return sm.Session.CreateCriteria<TestProject>()
                    .Add(Expression.Eq("UserId", userId))
                    .List<TestProject>();
            }
        }
        
    }
}
